﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TestForm
{
    public partial class Form1 : Form
    {
        //WeatherClockWidget.IWeatherProvider provider = null;
        public Form1()
        {
            InitializeComponent();
            //provider = new Foreca.Weather();
            //Time1.Text = Time2.Text = String.Empty;
            //WeatherClockWidget.Widget.LocaleManager = new HTCHome.Core.LocaleManager("d.str");
            //WeatherClockWidget.Widget.LocaleManager.LocaleCode = "ru-RU";
        }

        private void Search_Click(object sender, EventArgs e)
        {
            //if (provider != null)
            //{
            //    DateTime start = DateTime.Now;
            //    List<WeatherClockWidget.Domain.CityLocation> res = provider.GetLocation(Query.Text);
            //    List<F> fl = new List<F>();
            //    foreach (WeatherClockWidget.Domain.CityLocation cl in res)
            //        fl.Add(new F() { cl = cl });
            //    locList.DataSource = fl;
            //    Time1.Text = (DateTime.Now - start).ToString();
            //}
        }

        private void GetData_Click(object sender, EventArgs e)
        {
            //if (provider != null && locList.SelectedItem != null && locList.SelectedItem is F)
            //{
            //    DateTime start = DateTime.Now;
            //    WeatherClockWidget.Domain.CityLocation cl = ((F)locList.SelectedItem).cl;
            //    WeatherClockWidget.Domain.WeatherReport res = provider.GetWeatherReport(WeatherClockWidget.Widget.LocaleManager.LocaleCode, cl.Code, 1);
            //    result.Text = Newtonsoft.Json.JsonConvert.SerializeObject(res);
            //    Time2.Text = (DateTime.Now - start).ToString();
            //}
        }
    }
}
